﻿@{
    @using lso_2u_Web应用开发.Models;
    SessionHelper sessionHelper = new SessionHelper();
}
<!DOCTYPE html>

<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>@(ViewBag.Title ?? "服饰工艺业务管理系统")</title>

    <link rel="stylesheet" href="~/css/public.css">
    <script src="~/js/public.js" type="module"></script>
    <script src="~/js/bulma_navbar.js"></script>
    <script src="~/js/jquery.min.js"></script>
    <style>
        html,
        body {
            width: 100%;
            height: 100%;
            margin: 0;
        }

        #app {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
            position: fixed;
            top: 0;
        }

        .app-header {
            height: 52px;
            width: 100%;
            position: absolute;
        }

        .app-container {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
            padding-top: 52px;
        }

        .app-container .app-siderbar {
            height: 100%;
            width: 30%;
            max-width: 240px;
            min-width: 150px;
            float: left;
            padding: 12px;
            box-sizing: border-box;
            overflow: auto;
            box-shadow: 0 0 12px rgba(0, 0, 0, 0.2);
        }

        .app-container .app-main {
            height: 100%;
            overflow: auto;
            padding: 12px;
            box-sizing: border-box;
            background-color: #f2f2f2;
        }
    </style>
</head>

<body>

    <div id="app">
        <header class="app-header navbar has-shadow">
            <div class="navbar-brand">
                <a class="navbar-item" href="/">
                    <img src="~/img/logo.png" height="28" />
                </a>
                <a role="button" class="navbar-burger" data-target="menu_toggle">
                    <span aria-hidden="true"></span>
                    <span aria-hidden="true"></span>
                    <span aria-hidden="true"></span>
                </a>
            </div>

            <div class="navbar-menu" id="menu_toggle">
                <div class="navbar-start">
                    <!-- 未登录状态 -->
                    @{
                        if (!sessionHelper.IsLogined)
                        {
                            <a class="navbar-item" href="/User/LoginByCode">
                                分享码登录
                            </a>
                        }
                    }
                </div>

                <div class="navbar-end">
                    <!-- 已登录状态 -->
                    @{
                        if (sessionHelper.IsLogined)
                        {
                            <div class="navbar-item has-dropdown is-hoverable" style="margin-right: 12px">
                                <a class="navbar-link ">
                                    @await Component.InvokeAsync("UserAvatarInfo")
                                </a>

                                <div class="navbar-dropdown">
                                    <a class="navbar-item">
                                        个人信息
                                    </a>
                                    <a class="navbar-item">
                                        安全中心
                                    </a>
                                    <hr class="navbar-divider">
                                    <a class="navbar-item" href="/User/Logout">
                                        退出登录
                                    </a>
                                </div>
                            </div>
                        }
                    }

                    <!-- 未登录状态 -->
                    @{
                        if (!sessionHelper.IsLogined)
                        {
                            <div class="navbar-item">
                                <div class="buttons">
                                    <a class="button is-primary" href="/User/Register">
                                        <strong>注册</strong>
                                    </a>
                                    <a class="button is-light" href="/User/Login" style="margin-left: 12px;">
                                        登录
                                    </a>
                                </div>
                            </div>
                        }
                    }
                </div>
            </div>
        </header>

        <div class="app-container">
            <aside class="menu app-siderbar">
                <ul class="menu-list">
                    <li>
                        <a href="/User/Index">
                            <span class="icon">
                                <i class="fa-solid fa-comment"></i>
                            </span>
                            消息中心
                        </a>
                    </li>
                </ul>
                <p class="menu-label">
                    货源管理
                </p>
                <ul class="menu-list">
                    <li>
                        <a>
                            <span class="icon">
                                <i class="fa-solid fa-file-lines"></i>
                            </span>
                            订单中心
                        </a>
                        <ul>
                            <li>
                                <a>
                                    仪表盘
                                </a>
                            </li>
                            <li>
                                <a>
                                    订单列表
                                </a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a>
                            <span class="icon">
                                <i class="fa-solid fa-sack-dollar"></i>
                            </span>
                            账务中心
                        </a>
                    </li>
                </ul>

                <p class="menu-label">工厂管理</p>
                <ul class="menu-list">
                    <li>
                        <a>
                            <span class="icon">
                                <i class="fa-solid fa-list-check"></i>
                            </span>
                            任务中心
                        </a>
                    </li>
                    <li>
                        <a>
                            <span class="icon">
                                <i class="fa-solid fa-chart-line"></i>
                            </span>
                            任务数据
                        </a>
                    </li>
                </ul>

                <p class="menu-label">
                    个人中心
                </p>
                <ul class="menu-list">
                    <li>
                        <a href="/User/UserInfo">
                            <span class="icon">
                                <i class="fa-solid fa-user-gear"></i>
                            </span>
                            个人信息
                        </a>
                    </li>
                    <!-- >修改个人信息 -->
                    <li>
                        <a href="/User/SecurityCenter">
                            <span class="icon">
                                <i class="fa-solid fa-shield"></i>
                            </span>
                            安全中心
                        </a>
                    </li>
                    <!-- >修改密码 -->
                    <!-- >修改2FA -->
                    <li>
                        <a>
                            <span class="icon">
                                <i class="fa-solid fa-screwdriver-wrench"></i>
                            </span>
                            业务管理
                        </a>
                        <ul>
                            <li><a href="/Work/SupplierList">货源业务</a></li>
                            <li><a href="/Work/FactoryList">工厂业务</a></li>
                        </ul>
                    </li>
                </ul>
            </aside>
            <div class="app-main">
                <!-- Content -->
                @RenderBody()
            </div>
        </div>

    </div>

</body>
</html>